/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cse308.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author Aaron
 */
@Embeddable
public class AltcoursecoordinatorsPK implements Serializable {
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(nullable = false, length = 20)
    private String courseidentifier;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 20)
    @Column(nullable = false, length = 20)
    private String altcoordinator;

    public AltcoursecoordinatorsPK() {
    }

    public AltcoursecoordinatorsPK(String courseidentifier, String altcoordinator) {
        this.courseidentifier = courseidentifier;
        this.altcoordinator = altcoordinator;
    }

    public String getCourseidentifier() {
        return courseidentifier;
    }

    public void setCourseidentifier(String courseidentifier) {
        this.courseidentifier = courseidentifier;
    }

    public String getAltcoordinator() {
        return altcoordinator;
    }

    public void setAltcoordinator(String altcoordinator) {
        this.altcoordinator = altcoordinator;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (courseidentifier != null ? courseidentifier.hashCode() : 0);
        hash += (altcoordinator != null ? altcoordinator.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof AltcoursecoordinatorsPK)) {
            return false;
        }
        AltcoursecoordinatorsPK other = (AltcoursecoordinatorsPK) object;
        if ((this.courseidentifier == null && other.courseidentifier != null) || (this.courseidentifier != null && !this.courseidentifier.equals(other.courseidentifier))) {
            return false;
        }
        if ((this.altcoordinator == null && other.altcoordinator != null) || (this.altcoordinator != null && !this.altcoordinator.equals(other.altcoordinator))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cse308.entities.AltcoursecoordinatorsPK[ courseidentifier=" + courseidentifier + ", altcoordinator=" + altcoordinator + " ]";
    }
    
}
